package sefaz.util;

import java.util.Enumeration;
import java.util.ResourceBundle;

public class Resource {

	ResourceBundle fileProperties;
    Enumeration propertiesKey ;
    
    public Resource(){
    	fileProperties = ResourceBundle.getBundle("ApplicationResources");
    	propertiesKey = fileProperties.getKeys();
	}
	
    public Resource(String properties){
    	fileProperties = ResourceBundle.getBundle(properties);
    	propertiesKey = fileProperties.getKeys();
    }
    
	public String getChave(String chave){
		
		 
		 String valor = "";
		 
		  while (propertiesKey.hasMoreElements()) 
	      {
	    	  String key = (String)propertiesKey.nextElement();
	    	  if (chave.equals(key)){
	    		  valor = fileProperties.getString(key); 
	    	  } 
	      }
	      
	      return valor;
	}
}  
